global class copyaccount {
   
   webService static Integer amethod(Id a)    
    {
    opportunity o = [Select id,Accountid from opportunity where id =:a];
    List<Solution__c> soln = [select id,opportunity__r.id,Account__c,Deployment__c,Name,Product__c,RecordTypeId from Solution__c where opportunity__r.id =: a];
    List<Solution__c> solnA = Soln.clone();
    try{
    for(Solution__c sol: solnA)
       {
        sol.Account__c = o.Accountid; 
      
        
        
        insert sol;       
     }
     }
     catch(Exception e)
     {
     system.debug('EXCEPTION OCCURED' + e);
     }
     return soln.size();
    }
    }